package com.wq.wrongquestion.serviceimpl.chi;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wq.wrongquestion.entity.chi.ChineseEntity;
import com.wq.wrongquestion.mapper.chi.ChineseMapper;
import com.wq.wrongquestion.service.chi.ChineseService;

@Component
public class ChineseServiceimpl implements ChineseService{
    
    @Autowired
    public ChineseMapper ChineseMapper;
    @Override
    @Transactional
    public String getChineseZjnm(String zjID) {
        String zjNm=ChineseMapper.getChineseZjnm(zjID);
        return zjNm;
    }
    @Override
    @Transactional
    public List<String> getChineseZjID() {
       List<String> allZjID=ChineseMapper.getChineseZjID();
       return allZjID;
    }
    @Override
    @Transactional
    public List<String> getChineseZj() {
        List<String> zjInfo=ChineseMapper.getChineseZj();
        return zjInfo;
    }
    @Override
    @Transactional
    public void insChinese(ChineseEntity ChineseEntity) {
        ChineseMapper.insChinese(ChineseEntity);
    }
    @Override
    @Transactional
    public PageInfo<ChineseEntity> getChinese(Integer pageNumer,Integer pageSize,ChineseEntity ChineseEntity) {
        PageHelper.startPage(pageNumer, pageSize);
        List<ChineseEntity> Chinese=ChineseMapper.getChinese(ChineseEntity);
        PageInfo<ChineseEntity> pageChinese=new PageInfo<>(Chinese);
        return pageChinese;
    }

    @Override
    @Transactional
    public List<ChineseEntity> getChineseByID(Integer id) {
        List<ChineseEntity> Chinese=ChineseMapper.getChineseByID(id);
        return Chinese;
    }
    @Override
    @Transactional
    public Integer updChinese(ChineseEntity ChineseEntity) {
        return ChineseMapper.updChinese(ChineseEntity);
    }
    @Override
    @Transactional
    public Integer delChinese(Integer id) {
        return ChineseMapper.delChinese(id);
    }
    
}
